package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @Autowired
    private Environment env;
    @Value("${Test.name}")
    private String name;
    @RequestMapping("/test")
    public String Test(){
        System.out.println(name+"版本:"+env.getProperty("Test.version")+"\n描述:"+env.getProperty("Test.description"));
        return name+"版本:"+env.getProperty("Test.version")+"\n描述:"+env.getProperty("Test.description");
    }

}
